<template>
  <div id="app">
    <Son :fun1="hello"></Son>
    <hr>
    <Son2 :sonWorld="title"></Son2>
<!--    <button @click="hello(title)">父点击</button>-->
  </div>
</template>
<!-- 主(父)组件 -->
<script>
  /* 导入组件 */
  import Son from "./components/Son";
  import Son2 from "./components/Son2";
  export default {
    name: 'App',
    components: {Son2, Son}, //引用使用
    data() {
      return {
        title: "暂无"
      }
    },
    methods:{
      hello:function (world) {
        this.title=world;
      }
    }
  }
</script>

<style>
  #app {
    font-family: 'Avenir', Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-align: center;
    color: #2c3e50;
    margin-top: 60px;
  }
</style>
